#!/bin/bash

export BIN_FILE=bin/samebatch-multiproduct-binpacking

if [ "$1" != "" ]
then
	if [ -f ${BIN_FILE} ]; then
	    echo ${BIN_FILE} exists
	    for file in $1 $2 $3 $4 $5 $6 $7 $8 $9
	    do
		# Launch a "qsub" batch with the given filename as script
		if [ -f ${file} ] ; then
		    echo "starting qsub batch with file ${file}"
		    qsub ${file}
		    qstat
		else
		    echo "ERROR ${file} does not exist"
		fi
	    done
	else
	    echo "ERROR ${BIN_FILE} does not exists here: "
	    echo "  current dir=`pwd`"
	fi
else
	echo ""
	echo "Usage:"
	echo ""
	echo "  script/qsubstart script01.sge <script02.sge> <script03.sge> ..."
	echo ""
fi



